package ordnode.funcs;

import ordnode.IFunction;

public class Logsig implements IFunction {

	@Override
	public double calculate(double x) {
		return 1 / (1 + Math.exp(-x));
	}

	@Override
	public double dx(double x) {
		double o = calculate(x);
		return o * (1 - o);
	}

	@Override
	public double inverseFunction(double v) {
	//assume: 0 < y < 1
		return -Math.log(1 / v - 1);
	}

}
